Please explain the associativity and order of execution in this statement b= a + ++b + (a-b); () has the highest precedence. but a-b is not executed first.. It is just executed from left to right
int a=10,b=10; if(a=b) cout<<"equal"; else cout<<"Not Equal";
output: Not equal
implement factorial, do remeber to handle the overflow case, which is actually the key point, otherwise this problem will be too simple
Write a program which prints itself.
char str[80]; strcpy(str,"junk"); scanf("%[^india]",str); printf("%s",str);
What will be the output of this code snippet if the given input is “Gujarat”?
Give the output of the following program
int main { char ch[]={‘1’,’2’,’3’,’4’,’5’}; char *p = (char *)(&ch+1); char *q = &ch+1; printf(“%d %c %c”,sizeof(ch),*(p-1),*q); }
int x=123,y=231; int t=0; int l; l=x^y; while(l) { t++; l&=l-1; } printf("%d",t);
int main() { double i=2.0,j=1.0,sum=0.0; while(i/j>0.001) { j=j+j; sum=sum+(i/j); printf("%f\n",sum); } }
The question here is : For how many steps this while loop will run and what would be the best approximate value of the sum after the loop ends .
Find out what this function does.
int foo(int n) { int t,count=0; t=n; while(n) { count=count+1; n=(n-1)&t; } return count; }
how to print 2.3 instead of 2.300000 float type without using .1f;...........
write a program to accept an array of elements and divide each element in array by 3
can we defined array without specifying size in c ?
how can we turn-off the padding in structures?
#include<stdio.h> int main() { printf("%%dd",12); getchar(); return 0; }
allocate 2D array dynamically with min no. of malloc calls.
how to reverse a number in c without the use of any function
Can you specify a porgram to print the numbers from 1 to 10 and their squares without using a loop?
RSS link for this tag
You must log in to post.
Register or log in:
Lost Password?