C Manual Outputs
C Manual Outputs
C Manual Outputs
h>
void main(){
int a,b,temp;
scanf("%d %d",&a,&b);
temp=a;
a=b;
b=temp;
getch();
Output:-
#include<stdio.h>
void main()
int b,c,d,m;
b=4;
c=3;
d=7;
m=2*b*(c-d)/4;
printf("%d",m);
getch();
Output:
#include<stdio.h>
void main()
{
int a;
float b;
char c;
double d;
printf("\n enter the inter value for a");
scanf("%d",&a);
printf("%d",a); // %d is used to value of integer
printf("\n enter the inter value for b");
scanf("%f",&b);
printf("%f",b); // %f is used to value of float
printf("\n enter the inter value for c");
scanf("%c",&c);
printf("%c",c); // %c is used to value of character
printf("\n enter the inter value for d");
scanf("%lf",&d);
printf("%lf",d); // %lf is used to value of double
getch();
}
Output:
#include<stdio.h>
void main()
{
int n1,n2;
scanf("%d %d",&n1,&n2);
getch();
Output:
#include<stdio.h>
void main()
{
int n;
scanf("%d",&n);
n=n&2;
getch();
Output:
#include<stdio.h>
void main()
int n;
scanf("%d",&n);
n=n&2;
getch();
Output:
#include<stdio.h>
void main()
{
int rem,rev_no,n;
printf("\n enter the n");
scanf("%d",&n);
while (n>0)
{
rem=n%10;
printf("%d",rem);
n=n/10;
}
getch();
}
Output:
#include<stdio.h>
void main()
{
int n, reverse_no=0,rem,original_no;
printf("\n enter a number");
scanf("%d",&n);
original_no=n;
while(n!=0)
{
rem=n%10;
reverse_no=reverse_no*10+rem;
n=n/10;
}
if(original_no==reverse_no)
printf("the number is palindrome");
else
printf("the number is not palindrome");
getch();
}
Output:
#include <stdio.h>
void main()
{
int i;
for(i=5;i<=50;i=i+5)
printf("\t %d",i);
getch();
Output:
#include<stdio.h>
#include<conio.h>
void main()
{
int smallest,greatest,i,a[10];
printf("\n Enter the ten numbers");
for(i=0;i<=10;i++)
{
scanf("%d",&a[i]);
}
smallest=a[0];
for(i=0;i<=10;i++)
{
if(smallest>a[i])
{
smallest=a[i];
}
}
output:
greatest=a[0];
for(i=0;i<=10;i++)
{
if(a[i]>greatest)
{
greatest=a[i];
}
}
Output:
#include<stdio.h>
#include<conio.h>
void main() {
int i,j;
int sum[3][3];
for(i=0;i<3;i++) {
for(j=0;j<3;j++) {
sum[i][j]=matrix1[i][j]+matrix2[i][j];
for(i=0;i<3;i++) {
for(j=0;j<3;j++) {
printf("%d\t",sum[i][j]);
printf("\n");
getch();
}
#include <stdio.h>
#include <conio.h>
void main() {
int phy,chem,bio,math,comp;
float per;
/* Calculate percentage */
printf("Grade: Distinction\n");
else
printf("Grade: Fail\n");
getch();
}
#include<stdio.h>
#include<conio.h>
int main() {
float per;
scanf("%f", &per);
printf("Grade: Distinction\n");
printf("Grade: A\n");
printf("Grade: B\n");
printf("Grade: Pass\n");
else
printf("Grade: Fail\n");
getch();
}
#include<stdio.h>
void main()
{
int i,j,n=1;
for(i=1;i<=4;i++)
{
for(j=5;j>=1;j--)
{
if(j>i)
{
printf(" ");
}
else
{
printf(" %d",n++);
}
}
printf("\n");
}
getch();
}