Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
Author:-Sayyed Akeeb
Class:-FYMCA
RollNo:-44
Date:-28/08/15
*/
#include<stdio.h>
#include<conio.h>
void main()
clrscr();
printf("\nHello World");
getch();
Output:
/*Name:-Write a program to accept values of two numbers and print their addition.
Author:-Sayyed Akeeb
Class:-FYMCA
RollNo:-44
Date:-28/08/15
*/
#include<stdio.h>
#include<conio.h>
void main()
int a,b,c;
clrscr();
scanf("%d%d",&a,&b);
c=a+b;
printf("Addition=%d",c);
getch();
Output:-
/*Name:-Write a program to accept values of two numbers and print their subtraction.
Author:-Sayyed Akeeb
Class:-FYMCA
RollNo:-44
Date:-28/08/15
*/
#include<stdio.h>
#include<conio.h>
void main()
int a,b,c;
clrscr();
scanf("%d%d",&a,&b);
c=a-b;
printf("Subtraction=%d",c);
getch();
Output:-
/*Name:-Write a program to accept values of two numbers and print their multiplication in c
language.
Author:-Sayyed Akeeb
Class:-FYMCA
RollNo:-44
Date:-28/08/15
*/
#include<stdio.h>
#include<conio.h>
void main()
int a,b,c;
clrscr();
scanf("%d%d",&a,&b);
c=a+b;
printf("Addition=%d",c);
getch();
Output:-
/*Name:-Write a program to accept values of two numbers and print their division in c
language.
Author:-Sayyed Akeeb
Class:-FYMCA
RollNo:-44
Date:-28/08/15
*/
#include<stdio.h>
#include<conio.h>
void main()
int a,b,c;
clrscr();
c=a/b;
printf("Division=%d",c);
getch();
Output:-
Author:-Sayyed Akeeb
Class:-FYMCA
RollNo:-44
Date:-28/08/15
*/
#include<stdio.h>
#include<conio.h>
void main()
int c,r;
clrscr();
scanf("%d",&r);
c=3.142*r*r;
printf("Area of circle=%d",c);
getch();
Output:-
Author:-Sayyed Akeeb
Class:-FYMCA
RollNo:-44
Date:-28/08/15
*/
#include<stdio.h>
#include<conio.h>
void main()
{
int c,b,h;
clrscr();
scanf("%d%d",&b,&h);
c=0.5*b*h;
printf("Area of Triangle=%d",c);
getch();
Output:-
Author:-Sayyed Akeeb
Class:-FYMCA
RollNo:-44
Date:-28/08/15
*/
#include<stdio.h>
#include<conio.h>
void main()
int p,n,r,si;
clrscr();
scanf("%d",&p);
scanf("%d",&n);
scanf("%d",&r);
si=p*n*r/100;
printf("\nSimple Interest=%d",si);
getch();
Output:
/*Name:-Write a program to accept number from user and print its square and cube in c
language.
Author:-Sayyed Akeeb
Class:-FYMCA
RollNo:-44
Date:-28/08/15
*/
#include<stdio.h>
#include<conio.h>
void main()
int c,s,n;
clrscr();
scanf("%d",&n);
s=n*n;
c=n*n*n;
printf("\nSquare=%d\n",s);
printf("\nCube=%d",c);
getch();
Output:
/*Name:-Write a program to accept 2 values a & b and interchange their values in c language.
Author:-Sayyed Akeeb
Class:-FYMCA
RollNo:-44
Date:-28/08/15
*/
#include<stdio.h>
#include<conio.h>
void main()
int a,b,c;
clrscr();
scanf("%d",&a);
scanf("%d",&b);
c=a;
a=b;
b=c;
printf("%d\t%d",a,b);
getch();
Output:
/*Name:-Write a program to accept 2 numbers and print largest among them in c language.
Author:-Sayyed Akeeb
Class:-FYMCA
RollNo:-44
Date:-28/08/15
*/
#include<stdio.h>
#include<conio.h>
void main()
{
int a,b,c;
clrscr();
scanf("%d",&a);
scanf("%d",&b);
if(a>b)
printf("\n%d is largest:",a);
else
printf("\n%d is largest:",b);
getch();
Output: