0% found this document useful (0 votes)
23 views13 pages

MRNG Day 01

The document contains several C programs that demonstrate basic concepts like input/output, arithmetic operations, variable assignment, conditional statements, and finding maximum of given numbers. Each program is commented and contains sample input/output to explain the concept.

Uploaded by

pakomag183
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
23 views13 pages

MRNG Day 01

The document contains several C programs that demonstrate basic concepts like input/output, arithmetic operations, variable assignment, conditional statements, and finding maximum of given numbers. Each program is commented and contains sample input/output to explain the concept.

Uploaded by

pakomag183
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 13

DAY 1

17 April 2024 08:34 AM


#include <stdio.h>
int main()
{
int a,b,sum;
printf("Enter 2 number:");
scanf("%d%d",&a,&b);
sum=a+b;
printf("Sum = %d",sum);
return 0;
}
#include <stdio.h>
int main()
{
int a,b,sum;
printf("Enter 2 number:");
scanf("%d%d",&a,&b);
sum = printf("%*c%*c",a,' ',b,' ');
printf("\rSum = %d",sum);
return 0;
}

#include <stdio.h>
int main()
{
int a,b,temp;
printf("Enter 2 number:");
scanf("%d%d",&a,&b);
temp = a;
a=b;
b=temp;
printf("%d %d",a,b);
return 0;
}
#include <stdio.h>
int main()
{
int a,b;
printf("Enter 2 number:");
scanf("%d%d",&a,&b);
a=a+b;
b=a-b;
a=a-b;
printf("%d %d",a,b);
return 0;
}
#include <stdio.h>
int main()
{
int n,a,b,c,sum;
printf("Enter a number:");
scanf("%d",&n);
a=n%10;
n=n/10;
b=n%10;
c=n/10;
sum=a+b+c;
printf("%d",sum);
return 0;
}

#include <stdio.h>
int main()
{
int n,a,b,c,rev;
printf("Enter a number:");
scanf("%d",&n);
a=n%10;
n=n/10;
b=n%10;
c=n/10;
rev=a*100+b*10+c;
printf("%d",rev);
return 0;
}
#include <stdio.h>
int main()
{
int a,b;
printf("Enter 2 numbers:");
scanf("%d%d",&a,&b);
if(a>b)
printf("%d",a);
else
printf("%d",b);
return 0;
}
#include <stdio.h>
int main()
{
int a,b,c,max;
printf("Enter 3 numbers:");
scanf("%d%d%d",&a,&b,&c);
if(a>b)
{
if(a>c)
max=a;
else
max=c;
}
else
{
if(b>c)
max=b;
else
max=c;
}
printf("%d",max);
return 0;
}

#include <stdio.h>
int main()
{
int a,b,c,d,max;
printf("Enter 4 numbers:");
scanf("%d%d%d%d",&a,&b,&c,&d);
if(a>b)
{
if(a>c)
{
if(a>d)
max=a;
else
max=d;
}
else
{
if(c>d)
max=c;
else
max=d;
}
}
else
{
if(b>c)
{
if(b>d)
max=b;
else
max=d;
}
else
{
if(c>d)
max=c;
else
max=d;
}
}
printf("%d",max);
return 0;
}

You might also like