Professional Documents
Culture Documents
h>
int main(){
int a=5;
a=printf("Good")+printf("Boy");
printf("%d",a);
return 0;
}
C Introduction
OUTPUT
A=5%10
A=?
B=5/10
B=?
C=5/2
C=?
D=5.0/2
D=?
E=5.2%2.1
E=?
C Introduction
PROBLEMS:
PRINT FIRST AND LAST DIGIT OF TWO DIGIT
NUMBER???? EX: NUM=24 SPLIT IT AS 2 AND 4
READ DAYS AS INPUT AND FIND HOW MANY
MONTHS AND DAYS???? And Interms of Weeks
and days Ex: 32 days 1 month 2 days ,4 weeks
and 4 days
KP
C Introduction
#include<stdio.h>
int main(){
int a=2,b=7,c=10,d;
c=(a==b);
d=b>a;
printf("%d%d",c,d);
printf(%d,d);
return 0;
}
C Introduction
VALUE
(A<B)&&(B<A)
(A==B)||(A>B)
10 || 0
???
10 && 20
???
C Introduction
#include <stdio.h>
void main()
{
int x = 5;
if (x < 1)
printf("hello");
if (x == 5)
printf("hi");
else
printf("no");
}
#include <stdio.h>
void main()
{
int x = 0;
if (x == 0)
printf("hi");
else
printf("how are u");
printf("hello");
}
Main()
{
Int x=20;
If(x==20)
Printf(Hello);
Printf(hai);
}
#include <stdio.h>
int x;
void main()
{
if (x)
printf("hi");
else
printf("how are u");
}
Int i;
Main()
{
For(;i<=10;i++);
Printf(I value is %d,i);
Main()
{
Int x=20;//10
If(x==20)
Printf(Hello);
Printf(hai);
}
#include <stdio.h>
void main()
{
double ch;
printf("enter a value btw 1 to 2:");
scanf("%lf", &ch);
switch (ch)
{
case 1:
printf("1");
break;
case 2:
printf("2");
break;
}
}
#include<stdio.h>
int main(){
int a=2,b=7,c=10;
c=a==b;
printf("%d",c);
return 0;
}
Main()
{
Int i=22;
If(i=2)
Printf(PVPSIT);
Printf(PVPSIT);
}
include <stdio.h>
int main() {
int n; int i;
int j;
scanf("%d",&n);
for(i=1;i<=n;i++){
for(j=1;j<=i;j++){
printf("0");
} printf("\n");
} return 0; }
#include <conio.h>
#include <stdio.h>
void main()
{
int k=14;
clrscr();
printf("\n integer num is %d",k);
printf("\n octal num is %o",k);
printf("\n hexa num is %X",k);
getch();}
Main()
{int n,I,sum=0,
For(i=1;i<=10;i++)
{ sum+=I;
If(i%2)
Printf(%d,sum);
Else
Printf(%d,-sum);
}
}
Void main()
{
Int a[5]={1,4,9,16,25};
Printf(%d is square is %d ,n,a[n-1]);
}
Void main()
{
int n=6;
Char *name*+=,even,odd-;
Printf(%d is %s number,n,name[n%2]);
}
Main()
{
If(printf(pvpsit))
{
}
}
Main()
{
Int _=10;
Int __=20;
Printf(%d,_+__);
}
Sum of digits,
Palindrome,
Reverse
Armstrong number