Sunteți pe pagina 1din 5

PROGRAM:

#include<stdio.h>
main()
{
int a,rem;
printf("Enter a Number\n");
scanf("d",!a);
rem"a#;
if(rem""$)
printf("%he &i'en Number is E'en");
else
printf("%he &i'en Number is (dd");
)
OUTPUT:
Enter the number
#
%he *i'en number is e'en
PROGRAM:
#include<stdio.h>
main()
{
int a,b,c;
printf("Enter + Numbers\n");
scanf("ddd",!a,!b,!c);
if(a>b)
{
if(a>c)
{
printf("%he ,irst Number d(a) is -i**est\n",a);
)
)
else if(b>c)
{
printf("%he .econd Number d(b) is -i**est\n",b);
)else
printf("%he %hird Number d(c) is -i**est\n",c);
)
OUTPUT:
Enter + Numbers
/
0
1
%he ,irst Number / is -i**est
PROGRAM:
#include<stdio.h>
main()
{
int i,n,sum"$;
printf("Enter the ran*e\n");
scanf("d",!n);
i"2;
3hile(i<"n)
{
sum"sum4i;
i44;
)
printf("\n%he sum of first d numbers is d\n",n,sum);
)
OUTPUT:
Enter the ran*e
0
%he sum of first 0 numbers is 20
PROGRAM:
#include<stdio.h>
main()
{
int n,i,sum"$;
printf("Enter a Number\n");
scanf("d",!n);
do
{
i"n2$;
sum"sum4i;
n"n52$;
)3hile(n>$);
printf("%he .um of di*it is d\n",sum);
)
OUTPUT:
Enter a Number
0
%he .um of di*it is 0
PROGRAM:
#include<stdio.h>
main()
{
int a,b,ch,c;
printf("\nEnter the Number 26\n");
scanf("d",!a);
printf("\nEnter the Number #6\n");
scanf("d",!b);
printf("\n2.7dd\n#..ubtract\n+.8ultipl9\n:.;i'ide\n");
printf("\nEnter the <hoice6\n");
scanf("d",!ch);
s3itch(ch)
{
case 26
c"a4b;
printf("\n d 4 d " d\n",a,b,c);
brea=;
case #6
c"a>b;
printf("\n d > d " d\n",a,b,c);
brea=;
case +6
c"a?b;
printf("\n d ? d " d\n",a,b,c);
brea=;
case :6
c"a5b;
printf("\n d 5 d " d\n",a,b,c);
)
)
OUTPUT:
Enter the Number 26
:
Enter the Number #6
2
2.7dd
#..ubtract
+.8ultipl9
:.;i'ide
Enter the <hoice6#
:>2"+

S-ar putea să vă placă și