Professional Documents
Culture Documents
[1 marks * 5 = 5 marks]
a.)
b.)
int main()
{
int a = 10, b = 11, c = 15;
if(c <= 20 && ++a <= b)
printf("Yes\n");
else
printf("No\n");
int main()
{
int j = 4;
(!j != 1 ? printf("Welcome\n") : printf("Good Bye\n"));
return 0;
}
c.)
int main()
{
int i = 65;
char j = 'A';
if(i == j)
printf("C is WOW\n");
else
printf("C is a headache\n");
return 0;
}
d.)
int main()
{
char ch = 100;
char r = ch + 28;
printf("r = %d\n", r);
return 0;
}
e.)
int main()
{
int x = 4, y = 0, z;
while(x >= 0)
{
x--;
y++;
if(x == y)
continue;
else
printf("%d %d\n", x , y);
}
return 0;
}
[5 marks]
4. Write a C Program to input a positive integer number (having more than 1 digit) and find the
sum of first digit and last digit.
[5 marks]
for example if input: 12345 then output: 6 ( reason 1 + 5 = 6 )