see
A
WAP to suppress not reachable code warning using #pragma directive
#include<stdio.h>
#include<conio.h>
#pragma warn -rvl
#pragma warn -par
#pragma warn -rch
int f1()
{
int a;
}
void f2(int x)
{
printf("asd");
}
int f3()
{
int a=1;
return a;
a++;
}
int main()
{
f1();
f2(2);
f3();
getch();
}
Read More »
WAP to take the percentage marks of a student as input and find which division the student falls into using logical operators
#include<stdio.h>
#include<conio.h>
void main()
{
clrscr();
float p;
printf("Enter the Percentage ");
scanf("%f",&p);
if(p>=90 && p<=100)
printf("Division = A");
else if(p<90 && p>=75)
printf("Division = B");
else if(p<75 && p>=55)
printf("Division = C");
else if (p<55 && p>=35)
printf("Division = D");
else if(p<35 && p>=0)
printf("Division = E");
else
printf("Wrong input");
getch();
}
Read More »
WAP to find the simple interest by taking P, n and r as inputs
#include<stdio.h>
#include<conio.h>
void main()
{
clrscr();
float p,n,r;
printf("Enter the Principle");
scanf("%f",&p);
printf("Enter the Rate");
scanf("%f",&r);
printf("Enter the Time");
scanf("%f",&n);
float SI=((p*r*n)/100);
printf("Simple Interest is %f ",SI);
getch();
}
Read More »
WAP to find the area of rectangle by taking length and breadth as inputs
#include<stdio.h>
#include<conio.h>
void main()
{ clrscr();
float l,b,r;
printf("Area of Rectangle\n");
printf("Enter the length");
scanf("%f",&l);
printf("Enter the Breath");
scanf("%f",&b);
r=l*b;
printf("Area of the Rectangle is %f",r,"square meter");
getch();
}
Read More »
Subscribe to:
Posts (Atom)
