Programming c to print cube number given

                                      Programming c to print cube number given

#include<stdio.h>    int main(){    int number;    printf("enter a number:");    scanf("%d",&number);    printf("cube of number is:%d ",number*number*number);    return 0;  }    Output
enter a number:5cube of number is:125


                                    Program  sum of 2 numbers print

#include<stdio.h>   
int main(){   
int x=0,y=0,result=0; 

printf("enter first number:"); 
scanf("%d",&x); 
printf("enter second number:"); 
scanf("%d",&y); 

result=x+y; 
printf("sum of 2 numbers:%d ",result); 

return 0; 
}   
Outputenter first number:9
enter second number:9
sum of 2 numbers:18
Previous
Next Post »