C Programming Day-1

* WAP to print Hello World.

Source Code:-

#include<studio.h>

#include<conio.h>

Void main()

{

Clrscr();

Printf("Hello world");

getch();

}

Output:-

Hello world

*WAP to print multiplication.

Source Code:-

#include<studio.h>

#include<conio.h>

Void main()

{

int a,b,mul;

printf("Enter the no:-);

Scand("%d%d",&a,&b);

mul=a*b;

printf("multiplication is %d",mul);

getch();

}

Output:-

Enter the no:- 

3

8

multiplication is 24

*WAP to print Addition.

Source Code:-

#include<studio.h>

#include<conio.h>

Void main()

{

int a,b, sum;

printf("Enter the mo:-);

Scand("%d%d",&a,&b);

Sum=a+b;

printf("Addition is %d",sum);

getch();

}

Output:-

Enter the no:-

4

6

Addition is 10

*WAP to print Substraction.

Source Code:-

#include<stdio.h>

#include<conio.h>

Void main()

{

int a,b,sub;

printf("Enter the no:-");

Scand("%d%d",&a,&b);

sub=a-b;

printf("Substraction is %d",sub);

getch();

}

Output:-

Enter the no:-

4

2

Substraction is 2

*WAP to print division.

Source Code:-

#include<studio.h>

#include<conio.h>

Void main()

{

int a,b,div;

printf("Enter the no:-");

Scand("%d%d",&a,&b);

div=a/b;

printf("division is %d",div);

getch();

}

Output:-

Enter the no:-

5

4

division is 1




Comments

Popular Posts