This program shows how to declare and use int variables. Read roll number and marks from user and display it on screen.
#include<stdio.h>
int main()
{
int marks,rollno;
printf("Enter your Roll No:");
scanf("%d", &rollno);
printf("Enter your Marks:");
scanf("%d", &marks);
printf("Your Roll No: %d.\n", rollno);
printf("Your marks: %d", marks);
return 0;
}
Output of program#include<stdio.h>
int main()
{
int marks,rollno;
printf("Enter your Roll No:");
scanf("%d", &rollno);
printf("Enter your Marks:");
scanf("%d", &marks);
printf("Your Roll No: %d.\n", rollno);
printf("Your marks: %d", marks);
return 0;
}
Enter your Roll No:101
Enter your Marks:70
Your Roll No: 101.
Your marks: 70
nice
ReplyDelete