main()
{
while (strcmp(“some”,”some\0”))
printf(“Strings are not equal\n”);
}
Answer / susie
Answer :
No output
Explanation:
Ending the string constant with \0 explicitly makes no
difference. So “some” and “some\0” are equivalent. So,
strcmp returns 0 (false) hence breaking out of the while loop.
Is This Answer Correct ? | 3 Yes | 0 No |
print numbers till we want without using loops or condition statements like specifically(for,do while, while swiches, if etc)!
main() { extern int i; i=20; printf("%d",i); }
What are the following notations of defining functions known as? i. int abc(int a,float b) { /* some code */ } ii. int abc(a,b) int a; float b; { /* some code*/ }
#include<stdio.h> main() { FILE *ptr; char i; ptr=fopen("zzz.c","r"); while((i=fgetch(ptr))!=EOF) printf("%c",i); }
how to return a multiple value from a function?
Write a program to implement the motion of a bouncing ball using a downward gravitational force and a ground-plane friction force. Initially the ball is to be projected in to space with a given velocity vector
char *someFun1() { char temp[ ] = “string"; return temp; } char *someFun2() { char temp[ ] = {‘s’, ‘t’,’r’,’i’,’n’,’g’}; return temp; } int main() { puts(someFun1()); puts(someFun2()); }
#include<stdio.h> main() { int i=1,j=2; switch(i) { case 1: printf("GOOD"); break; case j: printf("BAD"); break; } }
create a login program that ask username and password. if you input username or password 3 times wrong, the program will terminate else the program will prompt a message "congratulations"
main() { int i=-1; -i; printf("i = %d, -i = %d \n",i,-i); }
#define a 10 void foo() { #undef a #define a 50 } int main() { printf("%d..",a); foo(); printf("%d..",a); return 0; } explain the answer
main() { char *p = “ayqm”; char c; c = ++*p++; printf(“%c”,c); }