1) In the following statements, what does 6 specify?
int num[6];
num[6]=21;
#include<stdio.h>
int main()
{
char j=1;
while(j < 5)
{
printf("%d, ", j);
j = j+1;
}
printf("\n");
return 0;
}
}
}
#include <stdio.h>
int main()
{
char star[10]="HelloWorld";
printf("%c\n",star[5]);
return 0;
}
#include<stdio.h>
int addmult(int ii, int jj)
{
int kk, ll;
kk = ii + jj;
ll = ii * jj;
return (kk, ll);
}
int main()
{
int i=3, j=4, k, l;
k = addmult(i, j);
l = addmult(i, j);
printf("%d %d", k, l);
return 0;
}
#include<stdio.h>
int sumdig(int);
int main()
{
int a, b;
a = sumdig(123);
b = sumdig(123);
printf("%d, %d", a, b);
return 0;
}
int sumdig(int n)
{
int s, d;
if(n!=0)
{
d = n%10;
n = n/10;
s = d+sumdig(n);
}
else
return 0;
return s;
}
#include<stdio.h>
int check(int);
int main()
{
int i=45, c;
c = check(i);
printf("%d", c);
return 0;
}
int check(int ch)
{
if(ch >= 45)
return 100;
else
return 10;
}
#include<stdio.h>
int main()
{
int i=5;
for(;scanf("%d", &i); printf("%d", i));
return 0;
}
#include<stdio.h>
int main()
{
char str1[] = "Hello";
char str2[] = "Fellow";
if(str1[2] == str2[3])
printf("Equal");
else
printf("Unequal");
return 0;
}
x=y=z=0;
#include<stdio.h>
int main()
{
int i=3;
switch(i)
{
case 1:
printf("Hello");
case 2:
printf("Hi");
case 3:
continue;
default:
printf("Bye");
}
return 0;
}
1. #include<stdio.h>
2. int main()
3. {
4. int i=1,j=1;
5. if(i=j)
6. {
7. printf("i=j");
8. }
9. else
10. {
11. printf("Not Equal");
12. }
13. }
1. #include<stdio.h>
2. int main()
3. {
4. int i=1;
5. for(;;)
6. {
7. printf("%d\n", i++);
8. if(i>10)
9. break;
10. }
11. return 0;
12. }
Comments
Post a Comment