Posts
 
Reputation
Joined
Last Seen
Ranked #4K
Strength to Increase Rep
+0
Strength to Decrease Rep
-0
100% Quality Score
Upvotes Received
3
Posts with Upvotes
2
Upvoting Members
3
Downvotes Received
0
Posts with Downvotes
0
Downvoting Members
0
1 Commented Post
0 Endorsements
~2K People Reached
Favorite Forums
Favorite Tags
c x 3
Member Avatar for abd2

hi, this is the code: #include <stdio.h> main() { int m1, m2, m3, m4, m5, per; printf("Enter marks in five subjects\n"); scanf("%d%d%d%d%d",&m1,&m2,&m3,&m4,&m5); per=(m1+m2+m3+m4+m5)/5; if(per>=60) printf("first division\n"); if((per>=50) && (per<60)) printf("second division\n"); if((per>=40) && (per<50)) printf("third division\n"); if(per<40) printf("fail\n"); } this is the output for: [root@localhost lbin]# gcc -o division division.c …

Member Avatar for kimchong
2
2K
Member Avatar for abd2

hi, this is the code for switch:[CODE] include <stdio.h> main() { int i=2; switch(i) { case 1; printf("i am in case 1\n"); break; case 2; printf("i am in case 2\n"); break; case 3; printf("i am in case 3\n"); break; default; printf("i am in default\n"); } }[/CODE] and this is the …

Member Avatar for mrnutty
1
152
Member Avatar for abd2

hi, This is the code to be changed to conditional operators: #include <stdio.h> main() { int x, min, max; printf("Enter val for max and x\n"); scanf("\n%d%d",&max,&x); if(x>max) min=max; else min=x; printf("%d\n",min); } the above code is runing but problem is when changed to conditional operators: #include <stdio.h> main() { int …

Member Avatar for Dave Sinkula
0
161