Beruflich Dokumente
Kultur Dokumente
#include<stdio.h>
void main()
{
int a=10,b=20,c=0;
c=a+b;
printf("\nc=%d",c);
}
output: ?
output: ?
output: ?
output: ?
//To find the total and per for three subjects marks
#include<stdio.h>
void main()
{
int m1=95,m2=89,m3=92,tot=0;
float p=0;
tot=m1+m2+m3;
p=tot/3;
printf("\nTotal=%d",tot);
printf("\nPer=%f",p);
}
output: ?
output: ?
//To find the total and per for three input subjects marks
#include<stdio.h>
void main()
{
int m1,m2,m3,tot=0;
float p=0;
printf("\Enter first subject marks");
scanf("%d",&m1);
printf("\Enter second subject marks");
scanf("%d",&m2);
printf("\Enter third subject marks");
scanf("%d",&m3);
tot=m1+m2+m3;
p=tot/3;
printf("\nTotal=%d",tot);
printf("\nPer=%f",p);
}
output: ?
output: ?
#include<stdio.h>
void main()
{
int n,ch;
printf("\n1- to square");
printf("\n2- to cube");
printf("\nEnter a number");
scanf("%d",&n);
printf("\nEnter your choice");
scanf("%d",&ch);
if(ch==1)
{
printf("\nSquare of n=%d",n*n);
}
else
{
printf("\nCube of n=%d",n*n*n);
}
}
output: ?