main()
{
int c[ ]={2.8,3.4,4,6.7,5};
int j,*p=c,*q=c;
for(j=0;j<5;j++) {
printf(" %d ",*c);
++q; }
for(j=0;j<5;j++){
printf(" %d ",*p);
++p; }
}
Answer / susie
Answer :
2 2 2 2 2 2 3 4 6 5
Explanation:
Initially pointer c is assigned to both p and q.
In the first loop, since only q is incremented and not c ,
the value 2 will be printed 5 times. In second loop p itself
is incremented. So the values 2 3 4 6 5 will be printed.
Is This Answer Correct ? | 46 Yes | 9 No |
Write a C function to search a number in the given list of numbers. donot use printf and scanf
Derive expression for converting RGB color parameters to HSV values
#include<stdio.h> main() { struct xx { int x; struct yy { char s; struct xx *p; }; struct yy *q; }; }
main() { char *p; printf("%d %d ",sizeof(*p),sizeof(p)); }
main() { float me = 1.1; double you = 1.1; if(me==you) printf("I love U"); else printf("I hate U"); }
main() { int i=5; printf("%d%d%d%d%d%d",i++,i--,++i,--i,i); }
Given an array of characters which form a sentence of words, give an efficient algorithm to reverse the order of the words (not characters) in it.
What is the output for the program given below typedef enum errorType{warning, error, exception,}error; main() { error g1; g1=1; printf("%d",g1); }
struct Foo { char *pName; }; main() { struct Foo *obj = malloc(sizeof(struct Foo)); clrscr(); strcpy(obj->pName,"Your Name"); printf("%s", obj->pName); } a. Your Name b. compile error c. Name d. Runtime error
main() { int i=10; i=!i>14; Printf ("i=%d",i); }
main( ) { int a[ ] = {10,20,30,40,50},j,*p; for(j=0; j<5; j++) { printf(ā%dā ,*a); a++; } p = a; for(j=0; j<5; j++) { printf(ā%d ā ,*p); p++; } }
int i,j; for(i=0;i<=10;i++) { j+=5; assert(i<5); }