#include int main(void) { int a,b,c; printf("enter value of a,b &c:"); scanf("%d%d%d",&a,&b,&c); if((a>b)&&(a>c)) printf("%d is greatest",a); if((b>a)&&(b>c)) printf("%d is greatest",b); if((c>b)&&(c>a)) printf("%d is greatest",c); }"> #include int main(void) { int a,b,c; printf("enter value of a,b &c:"); scanf("%d%d%d",&a,&b,&c); if((a>b)&&(a>c)) printf("%d is greatest",a); if((b>a)&&(b>c)) printf("%d is greatest",b); if((c>b)&&(c>a)) printf("%d is greatest",c); }">

Presentation is loading. Please wait.

Presentation is loading. Please wait.

Programming in C Part 2.

Similar presentations


Presentation on theme: "Programming in C Part 2."— Presentation transcript:

1 Programming in C Part 2

2 printf("enter value of a,b &c:"); scanf("%d%d%d",&a,&b,&c);
Program to print the greatest of three numbers #include<stdio.h> #include<conio.h> int main(void) { int a,b,c; printf("enter value of a,b &c:"); scanf("%d%d%d",&a,&b,&c); if((a>b)&&(a>c)) printf("%d is greatest",a); if((b>a)&&(b>c)) printf("%d is greatest",b); if((c>b)&&(c>a)) printf("%d is greatest",c); }

3 printf("enter any year:"); scanf("%d",&n); if(n%4==0)
Program to find if a year is a leap year or not int n; printf("enter any year:"); scanf("%d",&n); if(n%4==0) printf("year is leap year"); else printf("year is not leap year");

4 Question Write a program to print your name, Reg_number, and date of birth.


Download ppt "Programming in C Part 2."

Similar presentations


Ads by Google