Posts

Showing posts from 2017

C program to reverse a three digit integer number

Image

An example for "switch" case in c language

Image

c program to calculate power

Image
//program to check a number is prime or not in C Language #include<stdio.h> #include<conio.h> void main() {          int n,i,flag=0;          clrscr();          printf("\nEnter a number: ");          scanf("%d",&n);         for(i=2;i<n;i++)        {               if((n%i)==0)              {                   flag=1;              }         }         if(flag==0)         {               printf("\n%d is a prime number.,",n);          }          else          {           ...
//program to check odd/even in C Language #include<stdio.h> #include<conio.h> void main() {        int n        clrscr();        printf("\nEnter a number: ");        scanf("%d",&n);        if((n%2)!=0)        {               printf("\n%d is an odd number.",n);        }        else        {               printf("\n%d is an eveb number.",n);         }         getch(); }
program to add two number input by user. #include<stdio.h> void main() {      int a,b,c;      printf("Enter a number: ");      scanf("%d",&a);      printf("Enter a number: ");      scanf("%d",&b);      c=a+b;      printf("sum=%d",c); }
hello guys we are printing "hello world " in C language. #include<stdio.h> void main() {         printf("hello world"); }