C programming:Simple problems for beginners By SHAHRIAR

Start from the beginning
                                        

else

printf(“%d is bigger number.”,b);

return 0;

}

---------------------------------------------------------------------------------------------------------------------------------------

Problem#3:  Find the biggest number of any three numbers.

 

 

#include<stdio.h>

int main()

{

int a,b,c;

printf(“Input first number:”);

scanf(“%d”,&a);

printf(“Input second number:”);

scanf(“%d”,&b);

printf(“Input third number:”);

scanf(“%d”,&c);

if((a>b) && (a>c))

printf(“%d is biggest number.”,a);

else if((b>a) && (b>c))

printf(“%d is biggest number.”,b);

else

printf(“%d is biggest number.”,c);

return 0;

}

---------------------------------------------------------------------------------------------------------------------------------------

Problem#4:  Find if the number is positive or negative.

 

#include<stdio.h>

int main()

{

int a;

printf(“Input number:”);

scanf(“%d”,&a);

if(a>=0)

printf(“Positive number.”);

else

printf(“Negative number.”);

return 0;

}

---------------------------------------------------------------------------------------------------------------------------------------

Problem#5:  Find if the number is odd or even.

 

#include<stdio.h>

int main()

{

int a;

printf(“Input number:”);

scanf(“%d”,&a);

You've reached the end of published parts.

⏰ Last updated: Sep 19, 2011 ⏰

Add this story to your Library to get notified about new parts!

C programming:Simple problems for beginners By SHAHRIARWhere stories live. Discover now