TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
sami sam
NA
40
30.2k
I need help for using if and else functions in C Programming.
Aug 15 2012 7:39 AM
I am sure this program is ok but and dose not WORK.
#include <stdio.h>
int main (){
int x,y,z;
printf("please enter value of x");
scanf("%d",&x);
printf("please enter value of y");
scanf("%d",&y);
if (y == 0) {
printf("You can not divide by zero");}
else{
z = x / y;
printf("divide = %d \n",z);}
and also
#include <stdio.h>
int main (){
int x,y,z;
printf("please enter value of x");
scanf("%d",&x);
printf("please enter value of y");
scanf("%d",&y);
if (y != 0) {
z = x / y;
printf("Divide = %d \n",z);
}
else{
printf("You can not divide by zero");
}
Reply
Answers (
1
)
file handling
controls