No one has voted on any posts yet. Votes from other community members are used to determine a member's reputation amongst their peers.
main() { char str[30]; int i ,n=0; printf("enter stirng"); while(( str[n]= getche() ) !='\r') n++; str[n]='\0'; for(i=0;i<n;i++) putchar(str[i]); } this is a simple program. enter string as input and same string become output. nothing is wrong in this program. this program is in my book. my question is what is … |
|
Re:
Receive a number from the keyboard and tell you if it is divisible by 10, 5, 2 or if it is not divisible by any of these. Why this dont work? #include <stdio.h> #include <stdlib.h> #include <math.h> main() { int num; printf("number: "); scanf("%d", &num); if (num % 10 == … |
|
Re:
Calculate the total area and volume occupied by a cylinder. Correct or not? #include <stdio.h> #include <math.h> int main() { float At, V, r, h; printf("\n ===========Calculate the total area and volume occupied by a cylinder============\n"); printf("\n the base radius.......: "); scanf("%f", &r); printf("\n Cylinder height.: "); scanf("%f", &h); At … |