C++ Program .Write a program to print following pattern

(adsbygoogle = window.adsbygoogle || []).push({}); Write a program to print following pattern  1 2  3 4  5  6 #include<stdio.h> #include<conio.h> void main() { int i,j,temp=1; clrscr(); for(i=1;i<=3;i++) { for(j=1;j<=i;j++)   {   printf(" %d",temp);   temp=temp+1;   } printf("\n"); } getch(); } ...

C++ Program .Write a program to argument & return value

(adsbygoogle = window.adsbygoogle || []).push({}); #include<stdio.h> #include<conio.h> int add(int a,int b); void main() { int a,b,ans; clrscr(); printf("\n enter the value of a"); scanf("\n %d",&a); printf("\n enter the value of b"); scanf("\n %d",&b); ans=add(a,b); printf("\n addition is n%d",ans); getch(); } int add(int a1,int b1) { int c; c=a1+b1; return...

C++ Program .Write a program to function with no argument & no return value.

(adsbygoogle = window.adsbygoogle || []).push({}); #include<stdio.h> #include<conio.h> void add(); void main() { clrscr(); add(); getch(); } void add() { int a,b,c; printf("\n enter the value of a"); scanf("\n %d",&a); printf("\n enter the value of b"); scanf("\n %d",&b); c=a+b; printf("\n addition is %d",c); ...



C++ Program .Write a program to check given number is perfect or not using nested if..else.

(adsbygoogle = window.adsbygoogle || []).push({}); #include<stdio.h> #include<conio.h> void main() { int num,i,sum=0; clrscr(); printf("\n enter the number"); scanf("\n %d",&num); for(i=1;i<num;i++) { if(num%i==0)   {   sum=sum+i;   } } if(num==sum)   {   printf("\n number is perfect");   } else   {   printf("\n...

C++ Program .Write a program to call by value parameter are passed by using value.

(adsbygoogle = window.adsbygoogle || []).push({}); #include<stdio.h> #include<conio.h> void swap(int a,int b); void main() { int a,b; clrscr(); printf("\n enter the value of a"); scanf("\n %d",&a); printf("\n enter the value of b"); scanf("\n %d",&b); swap(a,b); getch(); } void swap(int a1,int b1) { int temp; temp=a1; a1=b1; b1=temp; printf("\n swapped...

C++ Program .Write a program to call by reference.

(adsbygoogle = window.adsbygoogle || []).push({}); #include<stdio.h> #include<conio.h> void swap(int *a,int *b); void main() { int a,b; clrscr(); printf("\n enter the value of a"); scanf("\n %d",&a); printf("\n Enter the value of b"); scanf("\n %d",&b); swap(&a,&b); getch(); } void swap(int *a1,int *b1) { int temp; temp=*a1; *a1=*b1; *b1=temp; printf("\n...


C++ Program .Write a program to input an integer number & cheack number is palindrom or not.

(adsbygoogle = window.adsbygoogle || []).push({}); #include<stdio.h> #include<conio.h> void main() { int num,rem,temp,sum=0; clrscr(); printf("\n enter the value of num"); scanf("\n %d",&num); temp=num; while(num>0) { rem=num%10; sum=rem+(sum+10); num=num/10; } if(temp==num) { printf("\n number is palindrome"); } else { printf("\n number is not...

C++ Program .Write a program to input integer number & cheack number is armstrong or not.

(adsbygoogle = window.adsbygoogle || []).push({}); #include<stdio.h> #include<conio.h> void main() { int num,rem,temp,sum=0; clrscr(); printf("\n enter the number"); scanf("\n %d",&num); temp=num; while(num>0) { rem=num%10; sum=sum+(rem*rem*rem); num=num/10; } if(temp==num) { printf("\n number is armstrong"); } else { printf("\n number is not...


C++ Program .Write a program to convert given character into uppercase &vice versa.

(adsbygoogle = window.adsbygoogle || []).push({}); #include<stdio.h> #include<conio.h> void main() { char ch,ans; clrscr(); printf("\n enter the character"); scanf("\n %c",&ch); if(ch>=65 && ch<=90) {   ans=ch+32;   printf("\n lowercase character is %c",ans);   }   if(ch>=97 && ch<=122)   {   ans=ch-32;  ...

C++ Program .Write a program to case.

#include<stdio.h> #include<conio.h> void main() { int ch; clrscr(); printf("\n enter the character"); scanf("\n %c",&ch); switch(ch) { case 1:    printf("\n you are in choice 1");    break; case 2:    printf("\n you are in choice 2");    break; case 3:    printf("\n you are in choice 3");   ...


C++ Program .Write a program to cheack whether given character is uppercase letter,lower case & digit.

(adsbygoogle = window.adsbygoogle || []).push({}); #include<stdio.h> #include<conio.h> void main() { char ch; clrscr(); printf("\n enter the character"); scanf("\n %c",&ch); if(ch>=65 && ch<=97) {   printf("\n character is uppercase");   }   if(ch>=97 && ch<=122)   {   printf("\n character is lowercase");  ...

C++ Program .Write a program to accept a character & display next & previus ascii value.

(adsbygoogle = window.adsbygoogle || []).push({}); #include<stdio.h> #include<conio.h> void main() { char ch; clrscr(); printf("\n enter the character"); scanf("\n %c",&ch); printf("\n the ascii value of character %d",ch); printf("\n the next value of character is %d",ch+1); printf("\n the previous ascii value character is %d",ch-1); getch(); ...


C++ Program .Write a program to cheack greater number in three number.

(adsbygoogle = window.adsbygoogle || []).push({}); #include<stdio.h> #include<conio.h> void main() { int a,b,c; clrscr(); printf("\n enter the value of a"); scanf("\n %d",&a); printf("\n enter the value of b"); scanf("\n %d",&b); printf("\n enter the value of c"); scanf("\n %d",&c); if(a>b&&a>c) { printf("\n a is grater"); } else { printf("\n...