Read OnLine C- Program Example

02_VARIABLE CONCEPT
PRAC 3 PRAC 4
//wap to print add
#include<stdio.h> #include<conio.h>
void main()
{
int a,b,ans;
clrscr();
printf("Enter 1st number:");
scanf("%d",&a);
printf("Enter 2nd number:");
scanf("%d",&b);
ans=a+b;
printf("Add=%d",ans);
getch();
}
-----output-----
Enter 1st number:23
Enter 2nd number:34
add=5
//wap to print char
#include<stdio.h>
#include<conio.h>
void main()
{
char a;
clrscr();
a='A';
printf("%c",a);
getch();
}
-------output-------
A
Previous Next
Download Download