#include<iostream>
using namespace std;
int main()
{
int x,z;
cout<<"Please enter 1st number="<<endl;
cin>>x;
cout<<"Please enter 2nd number="<<endl;
cin>>z;
int sum=x+z;
int subtract=x-z;
int product=x*z;
float divide=x/z;
int remainder=x%z;
cout<<"the sum is="<<sum<<endl;
cout<<"the sum is="<<subtract<<endl;
cout<<"the sum is="<<product<<endl;
cout<<"the sum is="<<divide<<endl;
cout<<"the sum is="<<remainder<<endl;
return 0;
}
#include<conio.h>
#include<stdio.h>
void main()
{
int a,b;
clrscr();
printf("Enter the value of a\n");
scanf("%d",&a);
printf("Enter the value of b\n");
scanf("%d",&b);
printf("Result of a and b is:\n%d",a+b);
getch();
}
#include<conio.h>
#include<stdio.h>
void main()
{
int i,j;
clrscr();
i=0;
while(i!=10)
{
printf("*\n);
i++;
}
getch();
}
#include<conio.h>
#include<stdio.h>
void main()
{
int i,j;
clrscr();
for(i=0;i<5;i++)
{
for(j=0;j<5;j++)
{
printf("*");
}
printf("\n");
}
getch();
}
#include<conio.h>
#include<stdio.h>
void main()
{
int a;
prinf("Enter the value of a\n");
scanf("%d",a);
switch(a)
{
case 1:
printf("1 is selected");
break;
case2:
printf("2 is selected");
break;
default:
printf("no number selected");
break;
}
getch();
}